﻿@using System.Data;
@using ZoomLa.BLL.Helper
@model ZoomLa.SQLDAL.SQL.PageSetting
@functions{
    public string GetCurStatus(DataRow dr)
    {
        return dr["Status"].ToString() == "99" ? "<span style='color:green;'>已审核<span>" : "<span style='color:red;'>待审核<span>";
    }
    public string GetRecom(DataRow dr)
    {
        return dr["Recommendation"].ToString() == "1" ? "<span style='color:green;'>是</span>" : "否";
    }
}
@{
    Model.cols = 9;
}
<div id="EGV">
    <table class="table table-bordered table-striped">
        <tr><td class="td_s"></td><td class="td_s">ID</td><td>用户</td><td>黄页名称</td><td>更新时间</td><td>样式名称</td><td>状态</td><td>是否推荐</td><td class="td_l">操作</td></tr>
        @foreach (DataRow dr in Model.dt.Rows)
        {
            <tr ondblclick="location = 'ApplyInfo?ID=@dr["ID"]';">
                <td align="left">
                    <input name="idchk" type="checkbox" value="@dr["id"]" />
                </td>
                <td>@dr["ID"]</td>
                <td><a href="javascript:;" onclick="user.showuinfo('@dr["UserID"]');">@dr["UserName"]</a></td>
                <td>@dr["CompanyName"]</td>
                <td>@dr["UpdateTime"]</td>
                <td class="text-center"><a href="AddPageStyle?menu=edit&sid=@dr["nodestyle"]" title="点击修改样式">@dr["PageNodeName"]</a></td>
                <td class="text-center">@MvcHtmlString.Create(GetCurStatus(dr))</td>
                <td class="text-center">@MvcHtmlString.Create(GetRecom(dr))</td>
                <td>
                    <a class="option_style" href="/Page/Default?pageid=@dr["id"]" target="_blank"><i class="fa fa-eye" title="预览"></i></a>
                    <a href="ApplyInfo?id=@dr["id"]"><i class="fa fa-pencil" title="修改"></i></a>
                    <a href="javascript:;" onclick="mvcpage.del({ ids: '@dr["ID"]', url: 'page_del', confirm: '确定要删除吗' });" class="option_style"><i class="fa fa-trash-o" title="删除"></i></a>
                    <a href="PageTemplate?ID=@dr["ID"]" title="栏目管理"><i class="fa fa-list-ul" title="栏目管理"></i>栏目管理</a>
                </td>
            </tr>
        }
        @Html.Partial("_page", Model)
    </table>
</div>